home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-12-17 | 9.7 KB | 261 lines | [TEXT/MPS ] |
- #
- # ****************************************************************************
- #
- # File Name: Persuasion.vu
- #
- # Contains: Quick look test script for Persuasion version 2.12
- #
- # Written by: Kevin Avoy, Ken Landreth, Michael Leong, Gil Spencer et al
- #
- # Copyright: © 1993 by Apple Computer, Inc., all rights reserved.
- #
- # ****************************************************************************
- # C h a n g e H i s t o r y (most recent first):
- # ****************************************************************************
- #
- # Vers Date Author Description
- # ---- -------- ------ ---------------------------------------------
- # <1.0.6> 9/30/93 KTA Initialize gFileName prior to gApptitle being updated by
- # launchTwitch().
- # <1.0.5> 9/28/93 KTA Added returnVal for ModifyDocument hook.
- # <1.0.2> 6/16/93 NAGA Renaming InitGlobals(ScriptLevel)to InitGlobals(ScriptLevel)
- # <1+> 5/25/93 NAGA Adding header and porting old files to follow new standards
- #
- # ****************************************************************************
- #
-
-
-
- ########################################################################
- # External libraries
- #=======================================================================
- Libraries "Output.Lib", "DoTasks.Lib","Draw.Lib","Print.Lib","UserInterface.Lib","DA.Lib", "Font.Lib", "Globals.Lib", "LaunchQuit.Lib", "TCS.Lib";
-
-
- #########################################################################
- ######## Application Specific Tasks
- #########################################################################
-
- #########################################################################
- # InitAppGlobals()
- #========================================================================
- # Author: KL
- # Description: Sets up the tool palette for Persuasion. This task
- # must be called first.
- # Parameters: None
- # Returns: Nothing
- # Examples: InitAppGlobals()
- #========================================================================
- # History:
- #
- ########################################################################
- task InitAppGlobals()
- begin
-
- logstr("setting up {global gApptitle}'s globals");
- global kClick, kDrag, kMultiDrag, kMultiClickDrag, kMultiClick;
- global kPalDocWind, kPalWind, kPullOffPal, kPopUpPal, kScrollPal;
- global kToolPaletteNum := 1;
- global kTextAttribPaletteNum := 2;
-
- global gTextStr;
-
- global gPaletteList := {
- { #### Start Palette #1 - Tools
- {0,19,23,235,0}, # Location of tools palette relative to the window
- kPalDocWind, # Palette type
- {1,12}, # Size of Tool matrix {numElemsWide,numElemsTall}
- {0,18}, # Offset between tools {h,v}
- 0, # Not used at this time
- 0 # Not used at this time
- } #### End Palette #1
-
- };
-
-
- ### Persuasion {Flag, Pattern, Line, Color}
- ### Palette Elements:= Tool#, Pal#, ToolName, ToolType, DblClktoEnd SetAttributes
- global SelectTool := { 1, 1, "Select", kClick, 0, {0} };
- global TextTool := { 2, 1, "Text", kClick, 0, {} };
- global StrtLineTool := { 3, 1, "Straight Line", kDrag, 0, {0} };
- global LineTool := { 4, 1, "Line", kDrag, 0, {0} };
- global RectTool := { 5, 1, "Rect", kDrag, 0, {0} };
- global RndRectTool := { 6, 1, "RndRect", kDrag, 0, {0} };
- global OvalTool := { 7, 1, "Oval", kDrag, 0, {0} };
- global ArcTool := { 8, 1, "Arc", kDrag, 0, {0} };
- global FreeFormTool := { 9, 1, "Free Form", kMultiDrag, 0, {0} };
- global PolygonTool := {10, 1, "Polygon", kMultiClick, 1, {0} };
- global ZoomInTool := {11, 1, "Zoom In", kClick, 0, {0} };
- global ZoomOutTool := {12, 1, "Zoom Out", kClick, 0, {0} };
-
- global OutlineViewTool := {'', {-9,28,3}, "OutlineView", 0, 0, {0} };
- global SlideViewTool := {'', {-9,46,3}, "SlideView", 0, 0, {0} };
- global NotesViewTool := {'', {-9,67,3}, "NotesView", 0, 0, {0} };
-
- global gToolList:={ #SelectTool,
- #TextTool,
- StrtLineTool,
- LineTool,
- RectTool,
- RndRectTool,
- OvalTool,
- ArcTool,
- FreeFormTool,
- PolygonTool#,
- #ZoomInTool, # These tools appear to cause VU to timeout
- #ZoomOutTool # These tools appear to cause VU to timeout
- };
-
- ### font characteristic lists
- global gFontSizeList := {'9','10','12','14','18', '24','72'};
- global gFontStyleList := {'Bold','Italic','Outline', 'Underline','Shadow',
- 'Superscript','Subscript'};
-
- ### Name of the Plain (style) menu item ####
- global gPlainStyle := "Plain"; # Plain-Style menu item
-
- ### How to get to the next line
- global gNextLineMethod := 1;
- ### 1 - ReturnKey, 2 - EnterKey, 3 - DownArrow Key, 4 - TabKey, {} - Move/Click, {'Untitled'} - Move relative to the window titled 'Untitled' /Click
-
- ### Does moving to the next line clear all font info
- global gNextLineClearsFontSettings := 0;
-
- global gWindowInset := {30,20,20,20}; # Inset to wind to get content region
-
- end; #InitAppGlobals
-
- #########################################################################
- # PersuasionScrapPict()
- #========================================================================
- # Author:
- # Description: Test ScrapPict.
- # Parameters: None
- # Returns: Nothing
- # Examples: PersuasionScrapPict();
- # Assumptions: None
- # Applications: Persuasion
- #========================================================================
- # History:
- #
- ########################################################################
- task PersuasionScrapPict()
- begin
- Logstr("Setting up for ScrapPict");
- SelectMenuItem("1", "Go To Slide", "View");
- Scrapbook(global kScrapPICT);
- end;
- #########################################################################
- # PersuasionSetupDoText()
- #========================================================================
- # Author:
- # Description: Test ScrapPict.
- # Parameters: None
- # Returns: Nothing
- # Examples: PersuasionSetupDoText();
- # Assumptions: None
- # Applications: Persuasion
- #========================================================================
- # History:
- #
- ########################################################################
- task PersuasionSetupDoText()
- begin
- Logstr("Setting up for DoText");
- Draw(global TextTool);
- end;
-
- #########################################################################
- # Views()
- #========================================================================
- # Author:
- # Description: Change views.
- # Parameters: None
- # Returns: Nothing
- # Examples: Views();
- # Assumptions: None
- # Applications: Persuasion
- #========================================================================
- # History:
- #
- ########################################################################
- task Views() begin
- LogStr( "Changing Views");
- SelectMenuItem("1", "Go To Slide", "View");
- SelectMenuItem("Slide Sorter", "View");
- SelectMenuItem("Outline", "View");
- SelectMenuItem("Notes", "View");
- SelectMenuItem("1", "Go To Slide", "View");
- end;
-
- #########################################################################
- # PersuasionModifyDocument()
- #========================================================================
- # Author: ML
- # Description: Modify Persuasion Document
- # Parameters: None
- # Returns: Nothing
- # Examples: PersuasionModifyDocument();
- # Assumptions: None
- # Applications: Persuasion
- #========================================================================
- # History:
- #
- ########################################################################
- task PersuasionModifyDocument()
- begin
- return(Scrapbook(global kScrapTEXT));
- end;
-
- #########################################################################
- # PersuasionPageSetup()
- #========================================================================
- # Author: ML
- # Description: Test Page Setup
- # Parameters: None
- # Returns: Nothing
- # Examples: PersuasionPageSetup();
- # Assumptions: None
- # Applications: Persuasion
- #========================================================================
- # History:
- #
- ########################################################################
- task PersuasionPageSetup()
- begin
- PageSetup();
- SpecialKey(returnKey , "Return Key"); # dismiss extra dialog
- end;
-
- ################################################################################
- #################### Main script ####################
- ################################################################################
- script Persuasion (ScriptLevel:= -1)
- begin
- InitGlobals(ScriptLevel); # initialize your general globals
- InitDraw();
- InitFonts();
- global gAppTitle := 'Persuasion';
- global gAppVersion := '2'; # version of app you will be running
- global gFileName := "@!@-{gBuildVers}-{gAppTitle}"; # This is used in SaveAs when saving files
- SuiteStart('Persuasion.vu'); # begin a new test suite
- if LaunchTwitch("{gAppTitle}",gAliasDirectory) # launch or twitch to your app
- begin
- global gCustomScrapPict:= task PersuasionScrapPict; # define app specific task InitAppGlobals(); # init app specific globals
- global gSetupDoText:= task PersuasionSetupDoText; # define app specific task
- global gModifyDocument:= task PersuasionModifyDocument; # define app specific task
- InitAppGlobals(); # init app specific globals
- (*
- *)
- DoSetUpApp(,,,,1,1);
- DoDraw();
- #DoText(); # Not done - typing text in Persuasion disables VU!
- Views();
- DoWindow();
- PersuasionPageSetup();
- DoCloseApp(1,,0); # extra dialog in page setup
- LogStr("############################# LIMITATIONS: ############################");
- LogStr("NOTE: DoText not done because typing text in Persuasion disables VU");
- end; # if LaunchTwitch("{gAppTitle}",gAliasDirectory)
- SuiteEnd();
- end; # script Persuasion